<admintpl file="header" />

<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
<link type="text/css" href="__PUBLIC__/js/select2/select2.min.css" rel="stylesheet" />


</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('ConstructionWorkContactForm/index')}">代建工作联系单管理</a></li>
            <li class="active"><a href="{:U('ConstructionWorkContactForm/add')}">新增代建工作联系单</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">
            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">
                        <div class="panel-body">
                            <form method="post" class="form-horizontal tg" action="{:U('ConstructionWorkContactForm/add_post')}">
                                <div class="row tg-header">
                                    <div class="col-md-12 text-center">
                                        <h3>代建工作联系单</h3>
                                    </div>
                                    <div class="col-md-12">
                                        <p class="tg-to">
                                            <label>工程名称:</label>
                                            <input type="text" class="input-xt input-deptname" value="杭州中医院丁桥分院"  />
                                        </p>
                                        <p class="pull-right tg-serialnum">
                                            <label>编号:</label>
                                            <input class="input-xt" name="code" type="text"  required/>
                                        </p>
                                    </div>
                                </div>
                                <div class="well">
                                    <div class="form-group">
                                        <label>主送:</label>
                                        <select name="main_delivery_department[]" id="main_delivery_department" style="width:60%;" class="select2" multiple="multiple" data-placeholder="选择主送单位">
                                            <foreach name="data" item="vo">
                                                <option value="{$vo.id}">{$vo.department_name}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label>抄送:</label>
                                        <select name="carbon_copy_department[]" id="carbon_copy_department" style="width:60%;" class="select2" multiple="multiple" data-placeholder="选择抄送单位">
                                            <foreach name="data" item="vo">
                                                <option value="{$vo.id}">{$vo.department_name}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label>事由:</label>
                                        <textarea class="form-control" style="width:100%;height:200px; border:1px solid #666;" name="main_content"></textarea>
                                    </div>
                                    <div class="text-right" style="margin-right:40px;">
                                        <p>单位 浙江五洲工程项目管理有限公司</p>
                                        <input type="hidden" name="send_department" value="浙江五洲工程项目管理有限公司" />
                                    </div>
                                    <div class="form-actions">
                                        <button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
                                        <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
                                    </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <script src="__PUBLIC__/js/jquery.js"></script>
    <script src="__PUBLIC__/js/common.js"></script>
    <script src="__PUBLIC__/js/select2/select2.min.js"></script>
    <script src="__PUBLIC__/js/select2/i18n/zh-cn.js"></script>
    <script src="__PUBLIC__/js/select2/select2.default.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".select2").select2();
        });

        $(".btn-primary").click(function () {
            var reslist = $("#carbon_copy_department").select2("data");    //多选
            console.log(reslist);
            return true;


/*add_post post 数据如下
code:
main_delivery_department:11
main_delivery_department:10
carbon_copy_department:8
carbon_copy_department:7
main_content:主送抄送多个部门测试
send_department:浙江五洲工程项目管理有限公司

*/
        })
    </script>

</body>
</html>